<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>订单历史</title>
    <link rel="stylesheet" href="../css/page-health-index.css"/>
    <link rel="stylesheet" href="../css/page-health-login.css"/>
    <link rel="stylesheet" href="../css/page-health-order.css"/>
    <link rel="stylesheet" href="../plugins/elementui/index.css"/>
    <script src="../plugins/jquery/dist/jquery.min.js"></script>
    <script src="../plugins/healthmobile.js"></script>
    <script src="../plugins/vue/vue.js"></script>
    <script src="../plugins/vue/axios-0.18.0.js"></script>
    <script src="../plugins/elementui/index.js"></script>
<!--    <script src="../plugins/vue/axios-0.18.0.js"></script>-->

</head>
<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div class="app" id="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">预约记录</span>
        <span class="f-right"><i class="icon-more"></i></span>
    </div>


    <!-- 页面内容 -->
    <div class="contentBox">



        <div style="float:left;width: 80%">
            <div class="input-row">
                起始日期:<input v-model="formDate.startDate" style="width: 100%;height: 30px;border: 0px" type="date"
                       class="input-clear">
            </div>
            <div class="input-row">
                截止日期:
                <input v-model="formDate.endDate" style="width: 100%;height: 30px;border: 0px" type="date"
                       class="input-clear">
                <span class="box-button">
        </span>
            </div>
<!--        <div class="date">-->
<!--            <label>开始日期</label>-->
<!--            <i class="icon-date" class="picktime"></i>-->
<!--            <input v-model="formDate.start" type="text" class="picktime" readonly>-->
<!--        </div>-->
<!--        <div class="date">-->
<!--            <label>结束日期</label>-->
<!--            <i class="icon-date" class="picktime"></i>-->
<!--            <input v-model="formDate.end" type="text" class="picktime" readonly>-->

<!--        </div>-->
<!--            <div class="block">-->
<!--                <el-date-picker-->
<!--                        v-model="formDate"-->
<!--                        type="daterange"-->
<!--                        align="left"-->
<!--                        unlink-panels-->
<!--                        range-separator="至"-->
<!--                        start-placeholder="开始日期"-->
<!--                        end-placeholder="结束日期"-->
<!--                        :picker-options="pickerOptions">-->
<!--                </el-date-picker>-->
<!--            </div>-->
        </div>
        <div  class="box-button" style="float:right;margin-top: 100px">
            <button @click="submit()" type="button" class="btn order-btn">查询</button>
        </div>
        <div class="list-column1" style="float: left;width: 100%">
            <ul class="list">
                <li class="list-item" v-for="his in setmealList">
                    <a class="link-page" :href="'history_detail.html?id='+his.order.id">
                    <img class="img-object f-left" :src="'https://java-test-1257253955.cos.ap-shanghai.myqcloud.com/'+his.setmeal.img" alt="">
                    <div class="item-body">
                        <h3 class="ellipsis item-title">体检人:{{his.member.name}}</h3>
                        <h4 class="ellipsis item-title">预约套餐:{{his.setmeal.name}}</h4>
                        <p class="ellipsis-more item-desc">点击查看预约详情</p>
                    </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>
<!-- 页面 css js -->
<script src="../plugins/vue/vue.js"></script>
<script src="../plugins/vue/axios-0.18.0.js"></script>
<!--<script src="../js/page-health-order.js"></script>-->
<script>
    var vue = new Vue({
        el:'#app',
        data:{
            formDate:{},
            setmealList:[]//模型数据，用于套餐列表展示
            // setmealList:[
            //     {member:{name:"张三"},order:{id:1},setmeal:{id:1,name:"入职体检",remark:"注意"}},
            //     {member:{name:"张三"},order:{id:1},setmeal:{id:1,name:"入职体检",remark:"注意"}},
            //     {member:{name:"张三"},order:{id:1},setmeal:{id:1,name:"入职体检",remark:"注意"}},
            // ]//模型数据，用于套餐列表展示
        },
        methods:{
            submit(){
                console.log(this.formDate)
                //发送ajax请求，根据cookie查询对应的用户预约信息，用于页面展示
                axios.post("/member/findHistorySetmeal.do",this.formDate).then((res) =>{
                    if(res.data.flag){
                        // this.$message({
                        //     type:"success",
                        //     message:res.data.message
                        // })
                        this.setmealList = res.data.data;
                    }else {
                        //没有登录,跳转到登录页面
                        window.location.href =res.data.data;
                    }
                });
            }
        },
        mounted(){
            axios.post("/member/findMemberByCookie.do").then((res) =>{
                if(res.data.flag){

                }else {
                    //没有登录,跳转到登录页面
                    window.location.href =res.data.data;
                }
            });
        }
    });
</script>
<script>
    //日期控件
    var calendar = new datePicker();
    calendar.init({
        'trigger': '.picktime',/*按钮选择器，用于触发弹出插件*/
        'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
        'minDate': getSpecifiedDate(new Date(),-180),/*最小日期*/
        'maxDate': getSpecifiedDate(new Date(),180),/*最大日期*/
        'onSubmit': function() { /*确认时触发事件*/
            //var theSelectData = calendar.value;
        },
        'onClose': function() { /*取消时触发事件*/ }
    });
</script>
</body>